//
//  ContentModel.m
//  BaseFramework01
//
//  Created by IMAC on 2017/6/2.
//  Copyright © 2017年 IMAC. All rights reserved.
//

#import "ContentModel.h"

@implementation ContentModel

+(void)requestForContentListBySuperModel:(BaseColumnModel *)baseModel  Success:(success)success failure:(failure)failure {
    
    NSURL *url = [[NSBundle mainBundle] URLForResource:@"testForContentListBySubColumnID.json" withExtension:nil];
    NSDictionary *dict  =  [NSJSONSerialization JSONObjectWithData:[NSData dataWithContentsOfURL: url ] options:NSJSONReadingAllowFragments error:nil];
    if (dict) {
        NSArray *dataArray = dict[@"data"][@"contentInfos"];
        NSMutableArray *arrm = [NSMutableArray arrayWithCapacity:dataArray.count];
        for (NSDictionary *modelDict in dataArray) {
            ContentModel *model = [[ContentModel alloc]initWithDict:modelDict];
            [arrm addObject:model];
        }
        if (success) {
            success(arrm);
        }
        
    }else{
        if (failure) {
            failure();
        }
        
        
    }
    
}
@end
